package com.jushu.storbox.entities;

import android.util.Log;

import java.io.Serializable;

import com.jushu.storbox.callback.IDataChangeNotify;

public class ResourceEntity implements Serializable, IDataChangeNotify {

    /** *  */
    private static final long serialVersionUID = 7206015191646059725L;

    /**
     * the resource id
     */
    protected String id = "";
    /**
     * the resource's owner id
     */
    protected String ownerBy;
    /**
     * the controller to update ui
     */
    private transient ControlInfo controlInfo = null;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOwnerId() {
        return ownerBy;
    }

    public void setOwnerId(String ownerId) {
        this.ownerBy = ownerId;
    }

    public String getOwnerBy() {
        return ownerBy;
    }

    public void setOwnerBy(String ownerBy) {
        this.ownerBy = ownerBy;
    }

    public ControlInfo getControlInfo() {
        return controlInfo;
    }

    public void setControlInfo(ControlInfo controlInfo) {
        this.controlInfo = controlInfo;
    }

    @Override
    public void notifyChange() {
        Log.i("test", "this = " + this);
        Log.i("test", "controlInfo != null = " + (controlInfo != null));
        if (controlInfo != null) {
            controlInfo.notifyChange();
        }
    }
}
